﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ATPlatforms.RabbitSkin.Serializers
{
    public class StringMessageSerializer<T> : ISerializeMessages<T>
    {
        public byte[] SerializeMessage(T message)
        {
            return Encoding.UTF8.GetBytes(message.ToString());
        }

        public T DeSerializeMessage(byte[] message)
        {
            return (T)(object) Encoding.UTF8.GetString(message);
        }
    }
}
